﻿namespace Whut.ObjectSharePointMapper
{
    using System;
    using Microsoft.SharePoint;

    public interface ISharePointSession
    {
        /// <summary>
        /// Wraps SPListItem with TEntity and store it in this session.
        /// </summary>
        /// <typeparam name="TEntity"></typeparam>
        /// <param name="item"></param>
        /// <returns></returns>
        TEntity Wrap<TEntity>(SPListItem item);

        /// <summary>
        /// Updates entity from this session.
        /// </summary>
        /// <typeparam name="TEntity"></typeparam>
        /// <param name="entity"></param>
        void Update<TEntity>(TEntity entity);

        void Delete<TEntity>(TEntity entity);
    }
}
